package com.example.admin.config;

import com.example.admin.annotation.Development;
import com.example.admin.example.A;
import com.example.admin.example.B;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Scope;

/**
 * @author zxs
 * @since 2020/03/31
 */
//@Configuration
//@Development
public class BeanConfig {

    @Bean
    @Scope(BeanDefinition.SCOPE_PROTOTYPE)
    public A a(){
        return new A();
    }

    @Bean
    public B b(){
        return  new B(){
            public A getA(){
                return a();
            }
        };
    }

}
